package com.example.demo;

import lombok.Data;

/**
 * @author pettyfox
 * @date 2020-03-07
 */
@Data
public class RestObjectResponse<T> {
    private int code;
    private T data;
    private String message;
    public static <T> RestObjectResponse<T> ok(T r){
        RestObjectResponse<T> restObjectResponse = new RestObjectResponse<>();
        restObjectResponse.setCode(200);
        restObjectResponse.setData(r);
        return restObjectResponse;
    }
}
